package com.jmemoir.base.common.exception;

import lombok.Data;
import org.springframework.http.HttpStatus;

/**
 * 业务异常
 *
 * @author Tellsea
 * @date 2023/8/2
 */
@Data
public class ServiceException extends RuntimeException {

    private Integer code;

    private String msg;

    public ServiceException(String msg) {
        super(msg);
        this.code = HttpStatus.INTERNAL_SERVER_ERROR.value();
        this.msg = msg;
    }

    public ServiceException(Integer code, String msg) {
        super(msg);
        this.code = code;
        this.msg = msg;
    }
}